package com.rd.student.jike.class1.jiangwanli.day0728;

import java.io.File;
import java.util.Random;
import java.util.Scanner;

public class DianMingQi02 {
    public static void main(String[] args) throws Exception{
        System.out.print("请输入随机人数: ");
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        File file = new File("all.txt");
        String[] strArr = file.list();
        for (int j = 0 ;j < num ;j++) {
            Random r = new Random();
            int randomIndex = r.nextInt(strArr.length);
            String randomName = strArr[randomIndex];
            System.out.println("随机的同学为：" + randomName);
        }
    }
}
